import React from "react";

//1.创建共享数据的数据
export const glabalData = {
  role:'admin',
  email:'58500184@163.com'
}

//创建全局修改状态的方法
export const globalAction = (data)=>({
    updateRole (val) {
       data.setState({
        role:val
       })
    }
})
//2.创建context  赋值初始共享数据
export const glabalContext = React.createContext(glabalData)